package com.hqd.ch03.v49.aop.framework.adapter;

import com.hqd.ch03.v49.aop.Advisor;
import com.hqd.ch03.v49.aopalliance.aop.Advice;
import com.hqd.ch03.v49.aopalliance.intercept.MethodInterceptor;

/**
 * Advisor适配器，将没有实现MethodInterceptor接口的
 * 转成对应的MethodInterceptor实现
 */
public interface AdvisorAdapter {
    /**
     * 是否能处理该通知
     *
     * @param advice
     * @return
     */
    boolean supportsAdvice(Advice advice);

    /**
     * 返回对应的MethodInterceptor实现
     *
     * @param advisor
     * @return
     */
    MethodInterceptor getInterceptor(Advisor advisor);
}
